package com.qf.smartplatform.mapper;/*
*王浩政 
*whz
2022/9/13
20:09
*小米商城
*/

import com.qf.smartplatform.pojo.SysUserOnline;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface OnlineUserMapper {
    @Insert("INSERT INTO sys_user_online values(#{sessionId},#{loginName},#{ipaddr},#{loginLocation},#{browser},#{os},#{status},#{startTimestamp},#{lastAccessTime},#{expireTime})")
    void addOnlineData(SysUserOnline sysUserOnline);

    @Select("SELECT login_name FROM sys_user_online WHERE login_name=#{login_name}")
    String dataExist(String loginName);

//    @Update("UPDATE sys_user_online SET sessionId=#{},loginName=#{loginName},ipaddr=#{ipaddr},loginLocation=#{loginLocation},browser=#{browser},os=#{os},status=#{status},startTimestamp=#{startTimestamp},lastAccessTime=#{lastAccessTime},expireTime=#{expireTime} WHERE login_name=#{loginName}")
//    void updateOnlineData(SysUserOnline sysUserOnline);
//}
@Update("UPDATE sys_user_online SET sessionId=#{sessionId},ipaddr=#{ipaddr},login_location=#{loginLocation},browser=#{browser},os=#{os},status=#{status},start_timestamp=#{startTimestamp},last_access_time=#{lastAccessTime},expire_time=#{expireTime} WHERE login_name =#{loginName}")
void updateOnlineData(SysUserOnline sysUserOnline);
}
